package com.yuwei.database.entity

import androidx.room.TypeConverter
import com.blankj.utilcode.util.GsonUtils

/**
 *
 * 数据库字段类型转换器
 */
class CustomTypeConverters {
    @TypeConverter
    fun arrayToString(array: ArrayList<String>): String {
        return GsonUtils.toJson(array)
    }
    fun stringToArray(json: String): ArrayList<String> {
        return GsonUtils.fromJson(json, ArrayList::class.java) as ArrayList<String>
    }
}